﻿

<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->
<%
	MenuInfoSearchEvent event = (MenuInfoSearchEvent)context.getSessionValue("MenuInfoSearchEvent");
	ObjectList list = MenuInfo.fetch().search(con,event);
%>

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<script language=javascript>

var list_code = "listMenuInfo";

function doSearch()
{

	SetValue("s_Id",GetValue("i_Id")); //ID

	SetValue("s_MenuCode",GetValue("i_MenuCode")); //菜单编码

	SetValue("s_MenuName",GetValue("i_MenuName")); //菜单名称

	SetValue("s_Url",GetValue("i_Url")); //菜单页面地址

	SetValue("s_DisplayOrder",GetValue("i_DisplayOrder")); //显示顺序

	SetValue("s_ShowType",GetValue("i_ShowType")); //显示类型

	SetValue("s_ParentCode",GetValue("i_ParentCode")); //父级菜单
	

	SetValue("s_OrderField",GetValue("i_OrderField")); //排序
	SetValue("s_OrderDesc",getCheckBoxValues("i_OrderDesc")); //升降序
	doCommonSearch();
}

function bizViewMenuInfo(id)
{
	viewWin("<%=Config.getSrv()%>?action_code=viewMenuInfo&Id="+id);
}

function doDelete()
{
	if(!hasChooseRadio("ids"))
	{
		bizMessage("删除","各级菜单信息");
		return false;
	}
	if(!bizConfirm("删除","各级菜单信息")) return false;
	SetAction("deleteMenuInfo");
	frm.submit();
}

function doToAdd()
{
	SetAction("toAddMenuInfo");
	frm.submit();
}

function doToUpdate()
{
	if(!checkOne("ids")) 
	{
		bizMessage("修改","各级菜单信息");
		return false;
	}
	SetValue("Id",getCheckBoxValue("ids"));
	SetAction("toUpdateMenuInfo");
	frm.submit();
}
function doToCopy()
{
	if(!checkOne("ids")) 
	{
		bizMessage("复制","各级菜单信息");
		return false;
	}
	SetValue("Id",getCheckBoxValue("ids"));
	SetAction("toCopyMenuInfo");
	frm.submit();
}

key_InitDefault();
key_RegSubmitHandler(doSearch);
</script>


<%=uiBody%>>

<%@ include file="/framework/menu.jsp"%>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="action_code" value="">
<input type=hidden name="Id" value="">
<input type=hidden name=sortOrder value="1">

<!--查询条件保留区域-->

<input type=hidden name="s_Id" value="<%=event.getId()%>"> <!--ID-->

<input type=hidden name="s_MenuCode" value="<%=event.getMenuCode()%>"> <!--菜单编码-->

<input type=hidden name="s_MenuName" value="<%=event.getMenuName()%>"> <!--菜单名称-->

<input type=hidden name="s_Url" value="<%=event.getUrl()%>"> <!--菜单页面地址-->

<input type=hidden name="s_DisplayOrder" value="<%=event.getDisplayOrder()%>"> <!--显示顺序-->

<input type=hidden name="s_ShowType" value="<%=event.getShowType()%>"> <!--显示类型-->

<input type=hidden name="s_ParentCode" value="<%=event.getParentCode()%>"> <!--父级菜单-->


<%@ include file="/framework/list_head.jsp"%>

<br>
<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
	int key_tab = 1 ;
%>


	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			ID：
		</td>
		<%=uiSearchInputTDHead%>>
			<input type="text" class="texts" name="i_Id" size="20" value="<%=event.viewId()%>" key_tab="<%=key_tab++%>">
		</td>		
	</tr>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			菜单编码：
		</td>
		<%=uiSearchInputTDHead%>>
			<input type="text" class="texts" name="i_MenuCode" size="20" value="<%=event.viewMenuCode()%>" key_tab="<%=key_tab++%>">
		</td>		
	</tr>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			菜单名称：
		</td>
		<%=uiSearchInputTDHead%>>
			<input type="text" class="texts" name="i_MenuName" size="20" value="<%=event.viewMenuName()%>" key_tab="<%=key_tab++%>">
		</td>		
	</tr>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			菜单页面地址：
		</td>
		<%=uiSearchInputTDHead%>>
			<input type="text" class="texts" name="i_Url" size="20" value="<%=event.viewUrl()%>" key_tab="<%=key_tab++%>">
		</td>		
	</tr>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			显示顺序：
		</td>
		<%=uiSearchInputTDHead%>>
			<input type="text" class="texts" name="i_DisplayOrder" size="20" value="<%=event.viewDisplayOrder()%>" key_tab="<%=key_tab++%>">
		</td>		
	</tr>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			显示类型：
		</td>
		<%=uiSearchInputTDHead%>>
			<input type="text" class="texts" name="i_ShowType" size="20" value="<%=event.viewShowType()%>" key_tab="<%=key_tab++%>">
		</td>		
	</tr>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			父级菜单：
		</td>
		<%=uiSearchInputTDHead%>>
			<input type="text" class="texts" name="i_ParentCode" size="20" value="<%=event.viewParentCode()%>" key_tab="<%=key_tab++%>">
		</td>		
	</tr>


	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			按排序：
		</td>
		<%=uiSearchInputTDHead%>>	
			<select name="i_OrderField">
				<option value="" <%=(event.getOrderField().equals("1"))?"selected":""%>>设置排序字段</option>
				
				<option value="ID" <%=(event.getOrderField().equals("ID"))?"selected":""%>>ID</option>
				
				<option value="MENU_CODE" <%=(event.getOrderField().equals("MENU_CODE"))?"selected":""%>>菜单编码</option>
				
				<option value="MENU_NAME" <%=(event.getOrderField().equals("MENU_NAME"))?"selected":""%>>菜单名称</option>
				
				<option value="URL" <%=(event.getOrderField().equals("URL"))?"selected":""%>>菜单页面地址</option>
				
				<option value="DISPLAY_ORDER" <%=(event.getOrderField().equals("DISPLAY_ORDER"))?"selected":""%>>显示顺序</option>
				
				<option value="SHOW_TYPE" <%=(event.getOrderField().equals("SHOW_TYPE"))?"selected":""%>>显示类型</option>
				
				<option value="PARENT_CODE" <%=(event.getOrderField().equals("PARENT_CODE"))?"selected":""%>>父级菜单</option>
				
			</select>
			&nbsp;&nbsp;
			<input type="radio" name="i_OrderDesc" value="false" <%=(event.isOrderDesc()==false)?"checked":""%> >升序
			<input type="radio" name="i_OrderDesc" value="true"  <%=(event.isOrderDesc()==true)?"checked":""%>  >降序
			<input type="button" value="查询" class="buttons" onclick="doSearch();return false;">&nbsp;<input type="button" value="清空" class="buttons" onclick="doClearEvent();return false;">
		</td>
	</tr>

<%=uiSearchEnd%>

<!--列表标题-->
<%=UIManager.addListHeadTitle("各级菜单信息列表")%>

<!--********************* Part6:List Area ***************-->

<%=uiListStart%>>

<%@ include file="/framework/list_foot.jsp"%>

<%
	int index = 1 ;
%>	
	<%=uiListHeadTR%>>
		<%=UIManager.addListHeadCheckBox() %>

		<%=UIManager.addListHead("ID",index++)%>

		<%=UIManager.addListHead("菜单编码",index++,"num")%>

		<%=UIManager.addListHead("菜单名称",index++)%>

		<%=UIManager.addListHead("菜单页面地址",index++)%>

		<%=UIManager.addListHead("显示顺序",index++,"num")%>

		<%=UIManager.addListHead("显示类型",index++)%>

		<%=UIManager.addListHead("父级菜单",index++,"num")%>
     
		<%=UIManager.addListHead("操作",-1)%>  
	<%=uiListHeadTREnd%>>
	
	<!--data-->
<%
	for(int i=0;i<list.size();i++)
	{
		MenuInfo obj = (MenuInfo)list.get(i);
%>
	<%=uiListDataTR[i%2]%> align=center>
    	<%=uiListDataTD%>>
    		<input type="checkbox" name="ids" value="<%=obj.getId()%>">
    	</td>
    	
    
    	<%=uiListDataTD%>><%=obj.viewId(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewMenuCode(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewMenuName(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewUrl(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewDisplayOrder(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewShowType(con)%></td>
    
    	<%=uiListDataTD%>><%=obj.viewParentCode(con)%></td>
        

    	<%=uiListDataTD%>>
    		<a href="" onclick="bizViewMenuInfo('<%=obj.getId()%>');return false;">浏览</a>
    	</td>
  	</tr>
<%	
	}
%>  

<%@ include file="/framework/list_foot2.jsp"%>

<%=uiListEnd%>


<!--********************* Part7:Action Area ***************-->
<%=uiCommandStart%>>
	<%=uiCommandTR%>>
		<%=uiCommandTD%>>
		<input type=button value="    添加   " class="buttons" onclick="doToAdd();return false;">
		<!--
		<input type=button value="    复制   " class="buttons" onclick="doToCopy();return false;">
		-->
		<input type=button value="    修改   " class="buttons" onclick="doToUpdate();return false;">
		<input type=button value="    删除   " class="buttons" onclick="doDelete();return false;">
		</td>
	</tr>	
<%=uiCommandEnd%>
</form>


<%@ include file="/framework/foot.jsp"%>

<!--
	Author    :Jackey
	FileName  :/system/base/MenuInfoList.jsp
-->
